<template>
	<view :class="['info-block-item',`info-block-item--${size}`,`info-block-item--${color}`]">
		<view class="info-block-item__label" @click.stop="tapOnClickLabel">
			<slot name="label"></slot>
		</view>
		<view class="info-block-item__content" @click.stop="tapOnClickContent">
			<slot></slot>
			<Arrow v-if="porps.arrow" />
		</view>
	</view>
</template>

<script setup lang="ts" name="InfoBlockItem">
	import Arrow from '@/components/arrow/arrow.vue';
	import { defineProps, withDefaults, defineEmits } from 'vue';
	interface Props { arrow ?: boolean; size ?: 'large' | ''; color ?: 'lr' | 'rl' | 'll' | 'rr' }
	const porps = withDefaults(defineProps<Props>(), {
		arrow: false,
		size: '',
		color: 'lr'
	});
	const emit = defineEmits<{ clickLabel : []; clickContent : [] }>();
	function tapOnClickLabel() {
		emit('clickLabel');
	}

	function tapOnClickContent() {
		emit('clickContent');
	}
</script>

<style lang="scss">
	.info-block-item {
		display: inline-flex;
		align-items: center;
		justify-content: space-between;
		flex-shrink: 0;
		width: 100%;
		padding: 16rpx 20rpx;
		box-sizing: border-box;
		font-size: 30rpx;
		font-weight: 400;



		&__label {
			display: inline-flex;
			flex-shrink: 0;
			color: #101010;
		}

		&__content {
			display: flex;
			align-items: center;
			flex: 1;
			justify-content: flex-end;
			color: #909090;
		}

		&--large {
			padding: 34rpx 20rpx;
			font-size: 32rpx;
			font-weight: 400;
		}

		&--rl {
			.info-block-item__label {
				color: #909090;
			}

			.info-block-item__content {
				color: #101010;
			}
		}
		
		&--ll {
		
			.info-block-item__label,
			.info-block-item__content {
				color: #101010;
			}
		}

		&--rr {

			.info-block-item__label,
			.info-block-item__content {
				color: #909090;
			}
		}
	}
</style>